<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\UserCompany */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'user_company'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="user-company-view">

    <p>
        <?= Html::a(Yii::t('common', 'update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('common', 'delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('common', 'are_you_sure_you_want_to_delete_this_item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            //'id',
            //'user_id',
            'name',
            [
                'attribute' => 'type',
                'value' => \common\helpers\TStringHelper::getCompanyType($model->type),
            ],
            'url:url',
            'telphone',
            'fax',
            'product',
            'category',
            'contact_user',
            'contact_mobile',
            'business',
            'business_photo:image',
            'origanization_code_photo:image',
            'certificate_photo:image',
            'opening_permit_photo:image',
            [
                'attribute' => 'status',
                'value' => \common\helpers\TStringHelper::getCompanyStatusText($model->status),
            ],
            'reason',
            //'version',
            //'created_by',
            [
                'attribute' => 'created_at',
                'value' => \common\helpers\TStringHelper::ShowDate($model->created_at, 1),
            ],
            //'created_from',
            //'created_ip',
            //'updated_by',
            [
                'attribute' => 'updated_at',
                'value' => \common\helpers\TStringHelper::ShowDate($model->updated_at, 1),
            ],
            //'updated_from',
            //'updated_ip',
            //'is_deleted',
        ],
        'template' => '<tr><th width="150px">{label}</th><td>{value}</td></tr>',
    ]) ?>

</div>
